/**
 * 
 */
package edu.rit.cs.ws.uddi;

import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.List;

import org.uddi.v3_service.DispositionReportFaultMessage;

import edu.rit.cs.web.pojos.Business;

/**
 * Defines the methods used to publish and, delete and find a business entity
 * and its web services.
 * 
 * @author Abhishek Shrestha (axs1430)
 * @author Juan Saldana (jjs6109)
 * @author Victor Alvarez (vxa1557)
 */
public interface UDDIService extends Serializable {
  /**
   * The category used on the business entities to later find them in the UDDI
   * registry.
   */
  public String CATEOGRY = "CSC779 stock market service";
  /**
   * The TModel we're using to set the category of the business entities.
   */
  public String T_MODEL = "uddi-org:types";

  /**
   * Publishes a business entity with a business service.
   * @see Business
   * 
   * @param busines An entity to publish into the UDDI registry
   * @throws DispositionReportFaultMessage
   * @throws RemoteException
   */
  void publish(Business busines)
    throws DispositionReportFaultMessage, RemoteException;

  /**
   * Deletes a business entity and its associated business services.
   * 
   * @param businessKey The key used to identify the business entity.
   * @throws DispositionReportFaultMessage
   * @throws RemoteException
   */
  void deleteBusiness(String businessKey)
    throws DispositionReportFaultMessage, RemoteException;

  /**
   * Fetches the details for a particular business entity. The fetch information
   * contains the list of business services and their end points.
   * 
   * @param businessKey The key used to identify the business entity.
   * @return
   * @throws DispositionReportFaultMessage
   * @throws RemoteException
   */
  Business getBusinessDetail(String businessKey)
    throws DispositionReportFaultMessage, RemoteException;

  /**
   * Fetches a list of business entities from the UDDI registry. The category
   * used to lookup the entities is {@link UDDIService#CATEOGRY}.
   * 
   * @return A list containing all of the business services found.
   * @throws DispositionReportFaultMessage
   * @throws RemoteException
   */
  List<Business> findAllBusinesses()
    throws DispositionReportFaultMessage, RemoteException;
}
